package org.emet.entity.biz;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

import org.apache.commons.lang.builder.ToStringBuilder;
import org.emet.help.CGResource;
import org.emet.jee.console.entity.BaseEntity;
import org.hibernate.annotations.Index;

/**
 * 服务项目
 * 
 * @author alex
 * 
 */
@Entity
@Table(name = "T_SERVICE_ITEM")
public class ServiceItem extends BaseEntity {

	@CGResource("编码")
	private String code;
	@CGResource("名称")
	private String name;
	@CGResource("单位")
	private String unit;
	@CGResource("单价")
	private double singlePrice;

	// 用车，冷藏，整容，告别，火化， 寄存， 其他服务。
	private Long typeId;
	private String type;

	@CGResource("备注")
	private String remark;

	@Index(name = "code_index")
	@Column(unique = true)
	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public Long getTypeId() {
		return typeId;
	}

	public void setTypeId(Long typeId) {
		this.typeId = typeId;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	@Index(name = "name_index")
	@Column(unique = true)
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getUnit() {
		return unit;
	}

	public void setUnit(String unit) {
		this.unit = unit;
	}

	public double getSinglePrice() {
		return singlePrice;
	}

	public void setSinglePrice(double singlePrice) {
		this.singlePrice = singlePrice;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	@Override
	public String toString() {
		return ToStringBuilder.reflectionToString(this);
	}
}
